	function clsScore_List(){
		this.listData = null;
		this._HTMLDom = null;
		this._init();
	}	
	
	clsScore_List.prototype = {
		_init: function(){
			var $layer = $("section#my_score>section>ul");
			this._HTMLDom = {
				"$layer": $layer
				, "$element": $layer.find(">li:first")	
			};
			$layer.empty();
		}	
		, setList: function(thisData){
			if(!this.listData) {			
				this.listData = [];	
			}			
			this.push(thisData);
		}
		, push: function(thisData){
			var thisClass = this;
			var $element = this._HTMLDom["$element"];
			var $tmp = [];
		
			for(var i=0;i<thisData.length;++i){
				$tmp.push($element.clone(true));
				$tmp[i].find("div.date").html(thisData[i]["날짜"]);
				$tmp[i].find("div.golf").html(thisData[i]["골프장코스명"]);
				$tmp[i].find("div.hole").html(thisData[i]["홀"]);
				$tmp[i].find("div.par").html(thisData[i]["파"]);				 
				$tmp[i].find("div.score").html(thisData[i]["스코어"]);
				
				this.listData.push(thisData[i]);
			}
			this.display($tmp);
		}
		, display: function(thisData){			
			var $layer = this._HTMLDom["$layer"];
					
			for(var i=0;i<thisData.length;++i){
				$layer.append(thisData[i]);	
			}
		}
		, spinStart: function(){		
			$.mobile.showPageLoadingMsg();
		}
		, spinEnd: function(){			
			$.mobile.hidePageLoadingMsg();				
		}
		, $getBtnMore: function(){
			return $("div.btn_area div.btn_more");
		}
		, $getList: function(){			
			return this._HTMLDom["$layer"].find("a");
		}
		, $getLayer: function(){
			return this._HTMLDom["$layer"];
		}
		, getListCount: function(){
			if(!this.listData) return 0;
			return this.listData.length;
		}
	}
	
	//데이터연동		
	function clsComm_MyScore(){
		this.scoreList = null;		
		this.scoreListPageData = null;
		this.scoreListRequest = null;
		
		this._init();
	}	
	clsComm_MyScore.prototype = {
		_init: function(){
			this.scoreListRequest = {
				"페이지": null
			}
			this.scoreListPageData = {
				"현재페이지": null
				, "전체수": null
				//, "페이지당수": 10
				//, "블럭당페이지": 1
			}
		}
//------------------------ 프로필조회------------------------//	
		, getScoreList: function(){
			var thisClass = this;
			
			var szPage = this.scoreListRequest["페이지"];
			
			var objJson = new MJson();
        	var cm = new ConnectionManager();

			objJson.putClient("userid", "golfin3");
        	objJson.putPub("sid", "US001");
        	objJson.putPub("servicename", "getMyScoreAllList");
        	objJson.putPub("listcount", 10);
        	objJson.putPub("currpageno", szPage);
				
        	objJson.putParameter("startDt", "");
        	objJson.putParameter("endDt", "");
        	objJson.putParameter("search", "");
        
        	cm.requestGet(objJson.getJsonString(), function(ret){
				thisClass.scoreList = [];
				
				var items = ret["msp"]["contents"]["items"];
				if(items){					
					thisClass.scoreListPageData["전체수"] = ret["msp"]["contents"]["@totalcount"];
					
					if(!items.length) items = new Array(items);
					
					for(var i=0;i<items.length;i++){
						var obj = items[i];
						
						var golfCourseName = "";
						
						if(_util.nvl(obj["reservSeq"]+"").substrEx(0, 1) == "D"){
							golfCourseName = _util.nvl(obj["golfclubId"]);
						}else{
							golfCourseName = _util.nvl(obj["golfclubName"]) + "/" + _util.nvl(obj["courseInfoName"]);
						}
						
						thisClass.scoreList.push({
							"예약코드": _util.nvl(obj["reservSeq"])					
							, "날짜": _util.nvl(obj["regDate"])
							, "골프장코스명": golfCourseName
							, "홀": _util.nvl(obj["holeCnt"])
							, "파": _util.nvl(obj["par"])
							, "스코어": _util.nvl(obj["score"])
						});
					}
				}
				
				$(thisClass).trigger("evtFinishScoreList");
			}, function($err) {
				alert($err);
			});
		}
		, getScoreListData: function(){
			return this.scoreList;	
		}
		, getScoreListPageData: function(){
			return this.scoreListPageData;
		}
		, setScoreListRequest: function(key,val){
			this.scoreListRequest[key]=val;
		}
		, getScoreListRequest: function(key){
			return this.scoreListRequest[key];
		}
//------------------------ 프로필조회------------------------//			
	}
	
	//컨트롤파일
	function MyScore(){
		this.objParam = null;
		this.objComm = null;	
		this.objScore_List = null;
	};
	
	MyScore.prototype = {
	    onPageShow : function() {
	    	$("a").attr("href", "").attr("data-rel", "");
	    	this._init();
	    }
	    , _init: function(){	    	
	    	$("section#my_score footer ul li").removeClass("on").eq(0).addClass("on");
	    	
			this.objComm = new clsComm_MyScore();
	      	this.objScore_List = new clsScore_List();
	      	
	      	this.getParam();
	      	
	      	this._role();
	      		      	
	      	this._bind();
	      	this._eventFinish();
		}
	   , _start: function(){
			//스코어목록 조회
	      	this.objScore_List.spinStart();
	      	this.objComm.setScoreListRequest("페이지",1);
	      	this.objComm.getScoreList();	      	
	    }
	    , _eventFinish: function(){
	    	var thisClass = this;
	    	
	    	//스코어목록 조회 완료 이벤트
		 	$(this.objComm).bind("evtFinishScoreList", function(event){
		 		var thisData = thisClass.objComm.getScoreListData();
		 		var totalCnt = thisClass.objComm.getScoreListPageData();
		 		
		 		thisClass.objScore_List.setList(thisData);
		 		thisClass.objScore_List.spinEnd();
		 		
		 		//더보기 버튼 
		 		if(thisClass.objScore_List.getListCount() >= totalCnt["전체수"]) {
		 			thisClass.objScore_List.$getBtnMore().hide();
		 		}else {
		 			thisClass.objScore_List.$getBtnMore().show();
		 		}
		 	});
	    }
		 , _bind: function(){
		 	var thisClass = this;
		 			 	
		 	//상세보기
		 	this.objScore_List.$getLayer().on("click","a",function(event){
		 		event.preventDefault();	
		 		var idx = thisClass.objScore_List.$getList().index($(this));		 		
		 		var score_seq = thisClass.objScore_List.listData[idx]["예약코드"];
		 		//<--초기화
		 		if(!_gf.MYPAGE_DATA) {
			 		_gf.MYPAGE_DATA  = {
			 			"예약코드": score_seq	
			 		}
			 	}
			 	
			 	_gf.MYPAGE_DATA["예약코드"] = score_seq;
			 	
			 	//초기화-->		 		
		 		$.mobile.changePage("my_score_view.html","slide",true);	
		 	});
		 	
		 	//전체스코어
		 	$("section#my_score>footer ul li:eq(0) a").click(function(event){
		 		event.preventDefault();	
		 		$.mobile.changePage("my_score.html","slide",true);	
		 	});
		 	
		 	//스코어등록
		 	$("section#my_score>footer ul li:eq(1) a").click(function(event){
		 		event.preventDefault();	
		 		_gf.MYPAGE_DATA  = {
		 			"예약코드": null	
		 		}
		 		$.mobile.changePage("my_score_record.html","slide",true);	
		 	});
		 	
		 	//나의스코어통계
		 	$("section#my_score>footer ul li:eq(2) a").click(function(event){
		 		event.preventDefault();	
		 		$.mobile.changePage("my_score_state.html","slide",true);	
		 	});
		 		
		 	//더보기
		 	this.objScore_List.$getBtnMore().click(function(event){
		 		var page = thisClass.objComm.getScoreListRequest("페이지");
		 		thisClass.objComm.setScoreListRequest("페이지",(page+1));
		 		thisClass.objComm.getScoreList();
		 	});
		 	
		 	//메뉴
		 	$("section#my_score nav ul li a:eq(0)").click(function(event){
		 		event.preventDefault();
		 		$.mobile.changePage( "../inc/navi.html","slide",true);	
		 	});
		 	
		 	//알림
		 	$("section#my_score nav ul li:eq(1)").click(function(event){
		 		event.preventDefault();
		 		$.mobile.changePage("../inc/info_booking.html","slide",true);	
		 	});
		 } 
		 , getParam: function(){
	    	
	    }
	    , _role: function(){
	    		if(!_util.getLogin("로그인")){
	    			alert("로그인 후 이용하실 수 있습니다.");		    			
	    			this.goNavi();		
	    			return;    	
	    		}
	    		
    			this._start();	    		
	   }
		, goNavi: function(){
    		$.mobile.changePage("../inc/navi.html","slide",true);
		}
	   , setParam: function(key, val){
		   	if(!_gf.MYPAGE_DATA){	
		   		_gf.MYPAGE_DATA = new Object();
		   	}
		   	if(val !== 0 && !val) {
		   		_gf.MYPAGE_DATA[key] = null;
		   	}
	   		_gf.MYPAGE_DATA[key] = val;    	
	   }
	}